const http = require("http");
const server = http.createServer();
server.on("request", (req, res) => {
  // d定义一个字符串
    const str = `您请求的 URL 地址是 ${req.url}，请求的 method 类型为 ${req.method}`;
    // 调用res.setHeader解决乱码问题
    res.setHeader('Content-Type','text/html; charset=utf-8')
    res.end(str);
    
});
server.listen(80, () => {
  console.log("server running at http://127.0.0.1");
});
